package
{
	import flash.display.Sprite;
	
	import model.Application;
	
	import org.aswing.JFrame;
	
	import view.character.CharacterInfoBar;
	import view.room.Room;
	import view.toolbar.alert.AlertPlayerOption;
	import view.toolbar.alert.AlertPlayerResult;
	import view.toolbar.loading.Loading;
	
	[SWF(width="841", height="542", frameRate="12")]
	public class UtbGame extends Sprite
	{
		private static var _instance:UtbGame;
		
		private var _loading:Loading
		
		public function UtbGame()
		{
			_instance = this;
			
			createUI()
		}
		
		public static function get instance():UtbGame{
			return _instance;
		}
		
		private function createUI():void
		{
			createBackground();
			createCharacterBar();
			createLoading();
			
			createToolbar();
			
			var url:String = "http://www.test.com/index.php";
			Application.instance().init(url);
			Application.instance().setBoastId(7);
			Application.instance().setCharacter(23, 22);
		}
		
		private function createCharacterBar():void
		{
			// TODO Auto Generated method stub
		}
		
		private function createToolbar():void
		{
			// TODO Auto Generated method stub
			// addChild(new AlertPlayerOption);
		}
		
		private function createLoading():void
		{
			_loading = new Loading;
			_loading.gameStage = this;
			addChild(_loading);	
		}
		
		private function createBackground():void
		{
			addChild(new Room);
		}
		
		public function showInfo(value:String):void{
			_loading.infoValue = value;
		}
		
		public function hideInfo():void{
			_loading.infoValue = "";
		}
	}
}